#! /bin/bash

echo "remove containers that is no longer running"
docker ps -a | awk   '$0 !~ /Up [1-9]+ / && $1 ~ /[1-9]/ {system("docker rm "$1)}'

echo "clean up intemediate images"
docker images | awk '$1 ~ /<none>/ {system("docker rmi "$3)}'
